import pandas as pd
from prefect import get_run_logger

from application.tasks.base_task import BaseTask


class PrintTask(BaseTask):
    """
    打印结果
    """

    def run(self, df: pd.DataFrame):
        """
        打印结果
        """
        logger = get_run_logger()
        print("打印数据集信息:")
        print(f"DataFrame shape: {df.head()}")
        logger.info(f"DataFrame shape: {df.shape}")
        logger.info(f"DataFrame columns: {df.columns.tolist()}")
        logger.info("First 5 rows:")
        logger.info(f"\n{df.head()}")
        return df
